<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, maximum-scale = 1, minimum-scale=1" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="viewport" content="target-densitydpi=device-dpi,width=640,user-scalable=0">
		<title>车栈-买车</title>
		<link href="css/style.css" rel="stylesheet" type="text/css" />
		<script text="type/javascript" src="js/jquery.js"></script>
		<script src="js/mui.min.js"></script>;
		<script src="js/app.js"></script>;
		<script type="text/javascript" language="javascript" src="js/jquery-1.8.2.min.js"></script>
		<script>
			(function(mui, doc) {
				mui.init({
					statusBarBackground: '#000000'
				});

				mui.plusReady(function() {
					var network = true;
					if(mui.os.plus) {
						mui.plusReady(function() {
							if(plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_NONE) {
								network = false;
							}
						});
					}
					var subbtn = doc.getElementById('sub_btn');

					subbtn.addEventListener('tap', function(event) {
						var datas = $("#myform").serializeArray();

						var postData = {
							apiUrl: web_url + "page_cardeal/cardeal_add.shtml",
							datas: {
								name: $("#name").val(),
								phone: $("#phone").val(),
								brand: $("#brand").val(),
								model: $("#model").val(),
								use_year: $("#use_year").val(),
								is_new: $("#is_new").val(),
								type:0
							}
						};

						app.postServer(postData,
							function(result) {
							 mui.toast("恭喜您提交成功，请等待工作人员与您联系");
                             var ws=plus.webview.currentWebview();
	                         plus.webview.close(ws);
								
								
							},
							function(err) {
								if(err) {
									plus.nativeUI.toast(err);
									return;
								}
							}
						);

					}, false);
				});

			}(mui, document));
		</script>

	</head>

	<body>
		<section class="section">
			<div class="top-gray">
				<a href="" class="back"><img src="images/back-gray.png"></a>
				<a class="pro_t">买车</a>
			</div>
			<div class="clear"></div>
			<div class="pos-top">
				<form action="" class="login" method="post" id="myform">
					<div class="zhmm">
						<input type="hidden" name="type" id="type" value="0" />
						<label class="buy"><span>*</span>姓名</label>
						<input type="text" class="buy_info" id="name" name="name" /></div>
					<div class="zhmm">
						<label class="buy"><span>*</span>电话</label>
						<input type="text" class="buy_info" id="phone" name="phone" /></div>
					<div class="zhmm">
						<label class="buy"><span>*</span>品牌</label>
						<input type="text" class="buy_info" id="brand" name="brand" /></div>
					<div class="zhmm">
						<label class="buy"><span>*</span>型号</label>
						<input type="text" class="buy_info" id="model" name="model" /></div>
					<div class="zhmm">
						<label class="labelnx">车辆使用年限</label>
						<input type="text" class="nianxian" id="use_year" name="use_year" /></div>
					<div class="zhmm">
						<lable class="user">
							<i class='input_style radio_bg'><input type="radio" name="is_new" id="is_new" value="0" checked="checked"></i> 新车
						</lable>
						<lable class="user">
							<i class='input_style radio_bg'><input type="radio" name="is_new" id="is_new" value="1"></i> 二手车
						</lable>
					</div>

					<input id="sub_btn" type="button" class="butl" value="确定">
				</form>
				<script text="type/javascript" src="js/input.js"></script>

			</div>

		</section>
	</body>

</html>